<?php


class Dataform_Form_Asset_Dataform extends WOW_Form_Abstract
{
     public $elementDecorators = array(
            'ViewHelper',
            array(array('data' => 'HtmlTag'), array('tag' => 'span' )),
            array('Label', array('tag' => 'div', 'class'  => 'flt col250')
            )
    );


    public function init()
    {
        $this->setMethod('post');
        $cat_model = new Category_Model_Category();
        $cats = $cat_model->getAllCategoryArray();

         // adding elements
        $this->addElement('text', 'FieldName', array(
            'filters'    => array('StringTrim'),
            'validators' => array(
                array('StringLength', true, array(4, 128))
            ),
            'required'  => true,
            'label'     => 'Field Name',
            'class'     => 'input-medium',
            'decorators'=> $this->elementDecorators
        ));

        $this->addElement('select', 'catid', array(
            'filters'    => array('StringTrim'),
            'required'  => true,
            'label'     => 'Select Category',
            'multiOptions' => $cats,
            'decorators'=> $this->elementDecorators
        ));

         $this->addElement('select', 'subcatid', array(
            'filters'    => array('StringTrim'),
            'required'  => true,
            'RegisterInArrayValidator' => false,
            'label'     => 'Select Sub-category',
            'multiOptions' => array('0' => 'Choose...'),
            'decorators'=> $this->elementDecorators
        ));

         $this->addElement('select', 'AssetCatLabelId', array(
            'filters'    => array('StringTrim'),
            'required'  => true,
            'RegisterInArrayValidator' => false,
            'label'     => 'Select Sub-category Label',
            'multiOptions' => array('0' => 'Choose...'),
            'decorators'=> $this->elementDecorators
        ));

        $this->addElement('select', 'isRequired', array(
            'filters'    => array('StringTrim'),
            'required'  => true,
            'RegisterInArrayValidator' => false,
            'label'     => 'Is Required',
            'multiOptions' => array('' => 'Choose...', '1'=> 'Yes', '0'=>'No' ),
            'decorators'=> $this->elementDecorators
        ));

        $this->addElement('select', 'InputValidation', array(
            'filters'    => array('StringTrim'),
            'required'  => true,
            'RegisterInArrayValidator' => false,
            'label'     => 'InputValidation ',
            'multiOptions' => array('0' => 'Choose...', 'Alphanumeric'=>'Alphanumeric', 'Integer' =>'Integer', 'Character' =>'Character', 'Date' =>'Date' ),
            'decorators'=> $this->elementDecorators
        ));

        $this->addElement('text', 'Length', array(
            'filters'    => array('StringTrim'),
            'validators' => array('alnum'),
            'required'  => true,
            'label'     => 'Max Length',
            'class'     => 'input-medium',
            'decorators'=> $this->elementDecorators
        ));

        $this->addElement('select', 'InputType', array(
            'filters'    => array('StringTrim'),
            'required'  => true,
            'RegisterInArrayValidator' => false,
            'label'     => 'Input Type',
            'multiOptions' => array('' => 'Choose...', 'textbox'=> 'Textbox', 'textarea'=>'Textarea', 'checkbox'=>'Checkbox', 'radio'=>'Radio', 'date'=>'Date' ),
            'decorators'=> $this->elementDecorators
        ));

         $this->addElement('submit', 'submit', array(
            'required' => false,
            'ignore'   => true,
            'value'    => 'Save'
        ));

         $this->addElement('hidden', 'id', array(
            'filters'    => array('StringTrim'),
            'decorators'=> $this->elementDecorators
        ));
    }
}


?>
